Programming with QuickTime VR

| Previous | Chapter contents | Chapter top | Section top | Next |

QTVRSetPanAngle

You can use the QTVRSetPanAngle function to set the pan angle of a QuickTime VR movie.

OSErr QTVRSetPanAngle (QTVRInstance qtvr, floatpanAngle);
qtvr
An instance of a QuickTime VR movie.
panAngle
The desired pan angle of the specified movie.
function result
A result code.

DESCRIPTION

The QTVRSetPanAngle function sets the pan angle of the QuickTime VR movie specified by the qtvr parameter to the value specified by the panAngle parameter. That value is constrained by the maximum and minimum pan angles of the movie. If the angle falls outside of those constraints and the control setting kQTVRWrapPan is disabled, the angle is set to the minimum or maximum, whichever is closer. If wrapping is enabled, the pan angle is clipped to fall within the constraints. Pan angle values are also clipped if the requested pan angle, when combined with the current tilt angle and field of view, would cause an image to lie outside the current constraints.

QTVRSetPanAngle returns the result code constraintReachedErr if wrapping is off and the angle is set to the minimum or maximum constraint value.

SPECIAL CONSIDERATIONS

The pan and tilt angles are subject to the current pan and tilt range constraints, as imposed by the viewing limits and the current field of view. Accordingly, if you want to change the field of view, you should do so before adjusting the pan or tilt angles. Otherwise, the pan and tilt angles are clipped against the current field of view, which may result in an incorrect view when you alter the field of view.

SEE ALSO

Use QTVGetPanAngle (link) to get the pan angle of a movie. Use QTVRGetViewingLimits (link) to get the current viewing limits of a movie. Listing 2-4 illustrates the use of QTVRSetPanAngle .


© 1997 Apple Computer, Inc.

| Previous | Chapter contents | Chapter top | Section top | Next |